.class public Lcom/openfeint/internal/ui/NestedWindow;
.super Landroid/app/Activity;
.source "NestedWindow.java"


# instance fields
.field private mIsVisible:Z

.field protected mLogoImage:Landroid/view/View;

.field protected mWebView:Landroid/webkit/WebView;

.field private final tag:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 23
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 20
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/openfeint/internal/ui/NestedWindow;->mIsVisible:Z

    .line 21
    const-string v0, "NestedWindow"

    iput-object v0, p0, Lcom/openfeint/internal/ui/NestedWindow;->tag:Ljava/lang/String;

    .line 24
    return-void
.end method

.method private isBigScreen()Z
    .locals 7

    .prologue
    const/16 v6, 0x3e8

    const/16 v5, 0x320

    const/4 v4, 0x1

    .line 41
    invoke-virtual {p0}, Lcom/openfeint/internal/ui/NestedWindow;->getWindowManager()Landroid/view/WindowManager;

    move-result-object v3

    invoke-interface {v3}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v0

    .line 42
    .local v0, d:Landroid/view/Display;
    invoke-virtual {v0}, Landroid/view/Display;->getWidth()I

    move-result v2

    .line 43
    .local v2, width:I
    invoke-virtual {v0}, Landroid/view/Display;->getHeight()I

    move-result v1

    .line 45
    .local v1, height:I
    if-le v1, v2, :cond_0

    if-lt v2, v5, :cond_0

    if-lt v1, v6, :cond_0

    move v3, v4

    .line 49
    :goto_0
    return v3

    .line 47
    :cond_0
    if-lt v2, v6, :cond_1

    if-lt v1, v5, :cond_1

    move v3, v4

    .line 48
    goto :goto_0

    .line 49
    :cond_1
    const/4 v3, 0x0

    goto :goto_0
.end method


# virtual methods
.method protected beforeSetContentView()V
    .locals 2

    .prologue
    .line 53
    invoke-direct {p0}, Lcom/openfeint/internal/ui/NestedWindow;->isBigScreen()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 54
    invoke-virtual {p0}, Lcom/openfeint/internal/ui/NestedWindow;->getWindow()Landroid/view/Window;

    move-result-object v0

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/view/Window;->requestFeature(I)Z

    .line 56
    :cond_0
    return-void
.end method

.method public fade(Z)V
    .locals 5
    .parameter "toVisible"

    .prologue
    const/high16 v4, 0x3f80

    const/4 v2, 0x0

    const/4 v3, 0x0

    .line 71
    iget-object v1, p0, Lcom/openfeint/internal/ui/NestedWindow;->mWebView:Landroid/webkit/WebView;

    if-eqz v1, :cond_1

    .line 72
    iget-boolean v1, p0, Lcom/openfeint/internal/ui/NestedWindow;->mIsVisible:Z

    if-eq v1, p1, :cond_1

    .line 73
    iput-boolean p1, p0, Lcom/openfeint/internal/ui/NestedWindow;->mIsVisible:Z

    .line 74
    new-instance v0, Landroid/view/animation/AlphaAnimation;

    if-eqz p1, :cond_2

    move v1, v2

    .line 75
    :goto_0
    if-eqz p1, :cond_0

    move v2, v4

    .line 74
    :cond_0
    invoke-direct {v0, v1, v2}, Landroid/view/animation/AlphaAnimation;-><init>(FF)V

    .line 76
    .local v0, anim:Landroid/view/animation/AlphaAnimation;
    if-eqz p1, :cond_3

    const/16 v1, 0xc8

    :goto_1
    int-to-long v1, v1

    invoke-virtual {v0, v1, v2}, Landroid/view/animation/AlphaAnimation;->setDuration(J)V

    .line 77
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/view/animation/AlphaAnimation;->setFillAfter(Z)V

    .line 78
    iget-object v1, p0, Lcom/openfeint/internal/ui/NestedWindow;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v1, v0}, Landroid/webkit/WebView;->startAnimation(Landroid/view/animation/Animation;)V

    .line 79
    iget-object v1, p0, Lcom/openfeint/internal/ui/NestedWindow;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v1}, Landroid/webkit/WebView;->getVisibility()I

    move-result v1

    const/4 v2, 0x4

    if-ne v1, v2, :cond_1

    .line 80
    iget-object v1, p0, Lcom/openfeint/internal/ui/NestedWindow;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v1, v3}, Landroid/webkit/WebView;->setVisibility(I)V

    .line 81
    const v1, 0x7f080010

    invoke-virtual {p0, v1}, Lcom/openfeint/internal/ui/NestedWindow;->findViewById(I)Landroid/view/View;

    move-result-object v1

    invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V

    .line 85
    .end local v0           #anim:Landroid/view/animation/AlphaAnimation;
    :cond_1
    return-void

    :cond_2
    move v1, v4

    .line 74
    goto :goto_0

    .restart local v0       #anim:Landroid/view/animation/AlphaAnimation;
    :cond_3
    move v1, v3

    .line 76
    goto :goto_1
.end method

.method protected layoutResource()I
    .locals 1

    .prologue
    .line 27
    const v0, 0x7f030005

    return v0
.end method

.method public onConfigurationChanged(Landroid/content/res/Configuration;)V
    .locals 0
    .parameter "newConfig"

    .prologue
    .line 61
    invoke-super {p0, p1}, Landroid/app/Activity;->onConfigurationChanged(Landroid/content/res/Configuration;)V

    .line 62
    return-void
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 2
    .parameter "savedInstanceState"

    .prologue
    .line 31
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 32
    invoke-static {p0}, Lcom/openfeint/internal/Util;->setOrientation(Landroid/app/Activity;)V

    .line 33
    invoke-virtual {p0}, Lcom/openfeint/internal/ui/NestedWindow;->beforeSetContentView()V

    .line 34
    invoke-virtual {p0}, Lcom/openfeint/internal/ui/NestedWindow;->layoutResource()I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/openfeint/internal/ui/NestedWindow;->setContentView(I)V

    .line 35
    const v0, 0x7f080011

    invoke-virtual {p0, v0}, Lcom/openfeint/internal/ui/NestedWindow;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/webkit/WebView;

    iput-object v0, p0, Lcom/openfeint/internal/ui/NestedWindow;->mWebView:Landroid/webkit/WebView;

    .line 36
    const v0, 0x7f080012

    invoke-virtual {p0, v0}, Lcom/openfeint/internal/ui/NestedWindow;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/openfeint/internal/ui/NestedWindow;->mLogoImage:Landroid/view/View;

    .line 37
    const-string v0, "NestedWindow"

    const-string v1, "onCreate"

    invoke-static {v0, v1}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 38
    return-void
.end method
